<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page language="java" import="java.util.*,
								 com.kylin.common.Constants,
								 com.kylin.common.util.*,
                                 com.kylin.module.user.orm.User,
                                 org.apache.struts.util.LabelValueBean" %>
<%@ page import="com.kylin.module.shop.orm.*,com.kylin.module.user.orm.*" %>
<%@ include file="/common/include/currUserInfo.jsp"%>

<%

	String newLanguage = request.getParameter("lang");
	if(newLanguage != null){
	    try{
	        Locale newLocale = UTool.getLocaleByLang(newLanguage);
	    	session.setAttribute(org.apache.struts.Globals.LOCALE_KEY,newLocale);
	        
		Company[] user_companys = (Company[])currUser.getSubs().toArray(new Company[0]);
		Company curr_company = (Company)user_companys[0];
	
	    for(int i=0;i<user_companys.length;i++){
	    	if(user_companys[i].getLanguage().equals(newLocale.toString()) ) 
			    curr_company = user_companys[i];
	    }
	   	session.setAttribute(Constants.CURR_LANG_COMPANY,curr_company);  
	    response.sendRedirect("/module/shop/company/manage1.jsp");

	    }catch(Exception e){}

	}

%>